package net.sky.oa.dao.infopub.impl;

import java.util.ArrayList;
import java.util.List;

import net.sky.oa.dao.SkyBaseDaoImpl;
import net.sky.oa.dao.infopub.InfNewsDao;
import net.sky.oa.model.InfNews;

import org.springframework.stereotype.Repository;

import com.htsoft.core.web.paging.PagingBean;

@SuppressWarnings("unchecked")
@Repository
public class InfNewsDaoImpl extends SkyBaseDaoImpl<InfNews> implements InfNewsDao {

	public InfNewsDaoImpl() {
		super.setPersistType(InfNews.class);
	}
	
	public List<InfNews> getDisplay(PagingBean pb)
	  {
		  ArrayList params = new ArrayList();
		  StringBuffer hql = new StringBuffer("from InfNews n where n.status ="+1);
		  hql.append(" order by n.createtime desc");
		  return findByHql(hql.toString(), params.toArray(), pb);
	  }
}
